package com.longge.wechat.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.test.context.transaction.TransactionConfiguration;
import org.springframework.transaction.annotation.Propagation;

import com.longge.wechat.dao.ShopDao;
import com.longge.wechat.entity.ShopEntity;
import com.longge.wechat.service.ShopService;

@Service
@Transactional(propagation = Propagation.REQUIRED)
@TransactionConfiguration(transactionManager = "txManager", defaultRollback = true)
public class ShopServiceImpl implements ShopService {
	@Resource
	private ShopDao shopDaoImpl;
	

	@Override
	public void saveShop(ShopEntity entity) {
		shopDaoImpl.saveShop(entity);
	}

	@Override
	public void deleteShop(ShopEntity entity) {
		
	}

	@Override
	public void updateShop(ShopEntity entity) {
		shopDaoImpl.updateShop(entity);
	}

	@Override
	public ShopEntity findShopById(int id) {
		return shopDaoImpl.findShopById(id);
	}

	@Override
	public List<ShopEntity> findAllShop(String name,int pageSize, int currentPage) {
		return shopDaoImpl.findAllShop(name,pageSize, currentPage);
	}

	@Override
	public int findAllCount() {
		return shopDaoImpl.findAllCount();
	}

	@Override
	public List<ShopEntity> findAllShopBySpecialtyId(Integer specialtyId,
			int pageSize, int currentPage) {
		return shopDaoImpl.findAllShopBySpecialtyId(specialtyId, pageSize, currentPage);
	}
}
